package com.aacar.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.aacar.constant.ConsFiled;
import com.aacar.dao.MemberDao;
import com.aacar.dto.ImageDto;
import com.aacar.entity.Member;
import com.aacar.service.UploadHeadUrlService;

@Service("uploadHeadUrlService")
public class UploadHeadUrlServiceImpl implements UploadHeadUrlService{
	
	@Autowired
	private MemberDao memberDao;
	
	public int saveHeader(ImageDto imageDto) {
		int result = 0;
		if(imageDto.getFlag().equals(ConsFiled.Upload_Flag_1)) {
			Member member = new Member();
			member.setMemberId(Long.parseLong(imageDto.getUserId()));
			member.setHeadUrl(imageDto.getHeadUrl());
			result = this.memberDao.updateMember(member);
		}
		return result;
	}

}
